package com.bafarat;
import java.awt.*;
import java.awt.event.*;
import java.util.Scanner;
import javax.swing.*;


public class TicTacToeV1 implements ActionListener {

private JFrame window = new JFrame("Tic-Tac-Toe");
private JButton button1 = new JButton("1");
private JButton button2 = new JButton("2");
private JButton button3 = new JButton("3");
private JButton button4 = new JButton("4");
private JButton button5 = new JButton("5");
private JButton button6 = new JButton("6");
private JButton button7 = new JButton("7");
private JButton button8 = new JButton("8");
private JButton button9 = new JButton("9");


public TicTacToeV1(){


window.setSize(300,300);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setLayout(new GridLayout(3,3));


window.add(button1);
window.add(button2);
window.add(button3);
window.add(button4);
window.add(button5);
window.add(button6);
window.add(button7);
window.add(button8);
window.add(button9);


button1.addActionListener(this);
button2.addActionListener(this);
button3.addActionListener(this);
button4.addActionListener(this);
button5.addActionListener(this);
button6.addActionListener(this);
button7.addActionListener(this);
button8.addActionListener(this);
button9.addActionListener(this);


window.setVisible(true);
}

public void actionPerformed(ActionEvent a) {
	  int Pressed = 1;
    if (Pressed ==1)
	JOptionPane.showMessageDialog( null, "you pressed a button ");

}

public static void main(String[] args){
new TicTacToeV1();
}
}